
import sys
import cv2
import numpy as np
import os
from moviepy.editor import VideoFileClip, concatenate_videoclips

# 合并视频
def mergeVideo(videofolder):
    video_files=[]
    for file_name in os.listdir(videofolder):
        video_files.append(videofolder+"\\"+file_name)

    video_clips = [VideoFileClip(video) for video in video_files]
    final_clip = concatenate_videoclips(video_clips, method='compose')
    final_clip.to_videofile(videofolder+"\\"+'merge_video.mp4', fps=25)

if __name__ == '__main__':
   prameters = []
   for i in range(1, len(sys.argv)):
      prameters.append(str(sys.argv[i]))
   mergeVideo(prameters[0])


